package concurrency.part1.task2;

import concurrency.part1.task2.sorts.ThreadMergeSort;

import java.util.Random;


public class Main {
    public static void main(String[] args) throws InterruptedException{
        int n=30;
        int a[]=generateRandomArray(n);
        printArray(ThreadMergeSort.sort(a,4));
    }

    public static int[] generateRandomArray(int n){
        int a[]=new int[n];
        Random r=new Random();
        for (int i = 0; i < n; i++) {
            a[i]=r.nextInt()%10000;
        }
        return a;
    }

    public static void printArray(int a[]){
        System.out.print(a[0]);
        for (int i = 1; i < a.length; i++) {
            System.out.print(" "+a[i]);
        }
        System.out.println();
    }
}
